home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / tclAppInit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-17  |  2.7 KB  |  108 lines

  1. /* 
  2.  * tclAppInit.c --
  3.  *
  4.  *    Provides a default version of the Tcl_AppInit procedure.
  5.  *
  6.  * Copyright (c) 1993 The Regents of the University of California.
  7.  * Copyright (c) 1994 Sun Microsystems, Inc.
  8.  *
  9.  * See the file "license.terms" for information on usage and redistribution
  10.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11.  */
  12.  
  13. #ifndef lint
  14. static char sccsid[] = "@(#) tclAppInit.c 1.11 94/12/17 16:14:03";
  15. #endif /* not lint */
  16.  
  17. #include "tcl.h"
  18.  
  19. /*
  20.  * The following variable is a special hack that is needed in order for
  21.  * Sun shared libraries to be used for Tcl.
  22.  */
  23.  
  24. #ifdef NEED_MATHERR
  25. extern int matherr();
  26. int *tclDummyMathPtr = (int *) matherr;
  27. #endif
  28.  
  29. /*
  30.  *----------------------------------------------------------------------
  31.  *
  32.  * main --
  33.  *
  34.  *    This is the main program for the application.
  35.  *
  36.  * Results:
  37.  *    None: Tcl_Main never returns here, so this procedure never
  38.  *    returns either.
  39.  *
  40.  * Side effects:
  41.  *    Whatever the application does.
  42.  *
  43.  *----------------------------------------------------------------------
  44.  */
  45.  
  46. int
  47. main(argc, argv)
  48.     int argc;            /* Number of command-line arguments. */
  49.     char **argv;        /* Values of command-line arguments. */
  50. {
  51.     Tcl_Main(argc, argv);
  52.     return 0;            /* Needed only to prevent compiler warning. */
  53. }
  54.  
  55. /*
  56.  *----------------------------------------------------------------------
  57.  *
  58.  * Tcl_AppInit --
  59.  *
  60.  *    This procedure performs application-specific initialization.
  61.  *    Most applications, especially those that incorporate additional
  62.  *    packages, will have their own version of this procedure.
  63.  *
  64.  * Results:
  65.  *    Returns a standard Tcl completion code, and leaves an error
  66.  *    message in interp->result if an error occurs.
  67.  *
  68.  * Side effects:
  69.  *    Depends on the startup script.
  70.  *
  71.  *----------------------------------------------------------------------
  72.  */
  73.  
  74. int
  75. Tcl_AppInit(interp)
  76.     Tcl_Interp *interp;        /* Interpreter for application. */
  77. {
  78.     if (Tcl_Init(interp) == TCL_ERROR) {
  79.     return TCL_ERROR;
  80.     }
  81.  
  82.     /*
  83.      * Call the init procedures for included packages.  Each call should
  84.      * look like this:
  85.      *
  86.      * if (Mod_Init(interp) == TCL_ERROR) {
  87.      *     return TCL_ERROR;
  88.      * }
  89.      *
  90.      * where "Mod" is the name of the module.
  91.      */
  92.  
  93.     /*
  94.      * Call Tcl_CreateCommand for application-specific commands, if
  95.      * they weren't already created by the init procedures called above.
  96.      */
  97.  
  98.     /*
  99.      * Specify a user-specific startup file to invoke if the application
  100.      * is run interactively.  Typically the startup file is "~/.apprc"
  101.      * where "app" is the name of the application.  If this line is deleted
  102.      * then no user-specific startup file will be run under any conditions.
  103.      */
  104.  
  105.     tcl_RcFileName = "~/.tclshrc";
  106.     return TCL_OK;
  107. }
  108.